pub struct ErrMsg(&'static str);

pub const UNKNOWN_CMD: ErrMsg = ErrMsg("NOT_SUPPORT Not support command.");
pub const WRONG_TYPE: ErrMsg =
    ErrMsg("WRONGTYPE Operation against a key holding the wrong kind of value");
pub const INVALID_ARG: ErrMsg = ErrMsg("ERR Invalid number of arguments specified for command.");
pub const SYNTAX_ERR: ErrMsg = ErrMsg("ERR Syntax error");
pub const INT_PARSE_ERR: ErrMsg = ErrMsg("failed to parse integer");

impl ErrMsg {
    pub fn new(content: &'static str) -> Self {
        Self(content)
    }

    pub fn msg(&self) -> &'static str {
        self.0
    }
}
